package com.func.infrastructure.persistent.po.activity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * <p>
 * RaffleActivityAccountDay
 * </p>
 *
 * @author Simon
 * @version 2025.03.14.1.0.0
 * @description 活动抽奖账户日次数POJO类
 * @since 2025-03-14
 */

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RaffleActivityAccountDay {

    private final static SimpleDateFormat dateFormatDay = new SimpleDateFormat("yyyy-MM-dd");

    /** 自增ID*/
    private Long id;

    /** 用户ID*/
    private String userId;

    /** 活动ID*/
    private Long activityId;

    /** 日期（yyyy-mm-dd）*/
    private String day;

    /** 日次数*/
    private Integer dayCount;

    /** 日次数-剩余*/
    private Integer dayCountSurplus;

    /** 创建时间*/
    private Date createTime;

    /** 更新时间*/
    private Date updateTime;

    public static String currentDay() {
        return dateFormatDay.format(new Date());
    }
}
